package me.xplabs.magic 
{
	import com.greensock.TweenMax;
	import flash.display.BitmapData;
	import flash.geom.Matrix;
	import flash.geom.Point;
	import me.xplabs.engine.Animation;
	import me.xplabs.interfaces.IObjectMatrix;
	import me.xplabs.model.skill.MSkillInfo;
	
	/**
	 * http://www.xplabs.me/
	 * @author xiaohan
	 * 特效动画
	 */
	public dynamic class MagicAnimate extends Animation 
	{
		public var objMatrix:IObjectMatrix;
		public function MagicAnimate() 
		{
			super();
		}
		

		override public function update():void 
		{
			super.update();
			if (objMatrix)
			{
				if ((objMatrix.angle > 45 && objMatrix.angle <= 180) || (objMatrix.angle<-45&&objMatrix.angle>=-180))
				{
					this.x = objMatrix.curPosX + bitmapData["x"];
					this.y = objMatrix.curPosY + bitmapData["y"];
				}else
				{
					this.x = objMatrix.curPosX - bitmapData["x"];
					this.y = objMatrix.curPosY - bitmapData["y"];
				}
				this.rotation = objMatrix.angle;
			}
		}

		override public function dispose():void
		{
			super.dispose();
			objMatrix = null;
		}
		
	}

}